package cn.ajb.filemanager.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.ajb.filemanager.dao.UserDao;
import cn.ajb.filemanager.entity.User;

/**
 * 业务类
 * @author zoujing
 *
 */
@Service
@Transactional
public class UserService {

	@Autowired
	private UserDao userDao;
	@Transactional(readOnly=true)
	public User findByAccountAndPassword(User user) {
		
		return userDao.findByAccountAndPassword(user);
	}
	@Transactional(readOnly=true)
	public User findById(String id) {
		// TODO Auto-generated method stub
		return userDao.findById(id);
	}

	public void updateUser(User user) {
		// TODO Auto-generated method stub
		 userDao.updateUser(user);
	}

	public void deleteUser(String id) {
		
		userDao.deleteUser( id);
	}

	
	public void insetUser(User user) {
		userDao.insetUser(user);
		
	}
	public List<User> selectUserList(){
		return userDao.selectUserList();
	}
}
